<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico"/>
    <link rel="Shortcut Icon" href="/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${base}/lib/html5.js"></script>
    <script type="text/javascript" src="${base}/lib/respond.min.js"></script>
    <script type="text/javascript" src="${base}/lib/PIE-2.0beta1/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="${base}/res/lib/Hui-iconfont/1.0.7/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>小青蛙电子发票平台</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <link rel="stylesheet" type="text/css" href="${base}/res/static/css/malladmin.css"/>
</head>
<body>

<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 开票税号管理 <span
        class="c-gray en">&gt;</span> 开票税号列表 <a class="btn btn-success radius r"
                                                style="line-height:1.6em;margin-top:3px"
                                                href="javascript:location.replace(location.href);" title="刷新"><i
        class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form method="get">
        <div class="text-l">
            单位名称：
            <input type="text" id="BCName" name="BCName" class="input-text" style="width:150px" , placeholder="请输入单位名称">
            识别号：
            <input type="text" id="TaxpayerNo" name="TaxpayerNo" class="input-text" style="width:150px" ,
                   placeholder="请输入纳税人识别号">
            状态：
            <span class="select-box inline">
                <select id="State" name="State">
                    <#list bCStateList?keys as key>
                        <option value="${bCStateList["${key}"]}">${key}</option>
                    </#list>
                </select>
            </span>
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
            <span>
                    <a class="btn btn-primary radius"
                       onclick="bcompany_add('新增税号', '${base}/bcompany/add', '400', '250')" href="javascript:;">
                        <i class="Hui-iconfont">&#xe600;</i>新增税号
                    </a>
                </span>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20"><span class="r">共有数据：<strong>10</strong> 条</span></div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <th width="80">编号</th>
                    <th width="120">开票单位</th>
                    <th width="100">行业编码</th>
                    <th width="80">管理员</th>
                    <th width="120">纳税人识别号</th>
                    <th width="120">地址/电话</th>
                    <th width="75">开户行/帐号</th>
                    <th width="60">收款人</th>
                    <th width="60">复核人</th>
                    <th width="60">开票人</th>
                    <th width="60">状态</th>
                    <th width="80">管理操作</th>
                </tr>
                </thead>
                <tbody>
                <#list model.data as bCompanyInfo>
                    <#assign state="${bCompanyInfo.state}" />
                <tr class="text-c">
                    <td>${bCompanyInfo.bcid}</td>
                    <td class="text-l">${bCompanyInfo.bcname}</td>
                    <td>${bCompanyInfo.industrycode}</td>
                    <td>${(bCompanyInfo.manager.userdetailInfo.realname)!""}</td>
                    <td>${bCompanyInfo.taxpayerno}</td>
                    <td>${bCompanyInfo.address}/${bCompanyInfo.phone}</td>
                    <td>${bCompanyInfo.bank}/${bCompanyInfo.bankacount}</td>
                    <td>${bCompanyInfo.payee}</td>
                    <td>${bCompanyInfo.reviewer}</td>
                    <td>${bCompanyInfo.biller}</td>
                    <td>
                        <#if state == 1>
                            正常
                        <#else>
                          关闭
                        </#if>
                    </td>
                    <td>
                        <div class="btn-manage">
                            <button class="btn">
                                管理
                            </button>
                            <div class="btn-drop">
                                <a href="javascript:;"
                                   onclick="bcompany_managerset('开票税号-设置管理员', '${base}/bcompany/managerselect/${bCompanyInfo.bcid}', '', '510')">设置管理员</a>
                                <#--<a href="javascript:;"-->
                                   <#--onclick="bcompany_loginConfig('开票税号-设置登录界面','${base}/bcompany/bcompanyloginconfig/${bCompanyInfo.bcid}','','550')">设置登录界面</a>-->
                                    <#if state == 1>
                                        <a style="text-decoration:none" bcid="${bCompanyInfo.bcid}"
                                           onclick="bcompany_changeState(this,0)" href="javascript:;">关闭</a>

                                    <#else>
                                        <a style="text-decoration:none" bcid="${bCompanyInfo.bcid}"
                                           onclick="bcompany_changeState(this,1)" href="javascript:;">开启</a>
                                    </#if>
                                <#--<a href="javascript:;"-->
                                   <#--onclick="bcompany_syncConfig('开票税号-对接配置', '${base}/bcompany/bcompanysyncconfig/${bCompanyInfo.bcid}', '', '550')">对接配置</a>-->
                                <a href="javascript:;"
                                   onclick="bcompany_FPAPIConfig('开票税号-开票接口配置', '${base}/bcompany/fpapiconfig/${bCompanyInfo.bcid}', '', '400')">开票接口配置</a>
                            </div>
                        </div>
                    </td>
                </tr>
                </#list>
                </tbody>
            </table>

        </div>

    </form>

</div>
<script src="${base}/res/lib/jquery/1.9.1/jquery.js"></script>
<script src="${base}/res/lib/layer/2.1/layer.js"></script>

<script src="${base}/res/static/h-ui/js/H-ui.js"></script>
<script src="${base}/res/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--业务脚本-->
<script>
    /*开票税号-对接配置*/
    function bcompany_syncConfig(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    //开票税号-新增
    function bcompany_add(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    //开票税号-设置管理员
    function bcompany_managerset(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    /*开票税号-停用*/
    function bcompany_changeState(obj, state) {
        var bcid = $(obj).attr('bcid');

        if (state == 0) {
            layer.confirm('确认要关闭此税号吗？', function (index) {
                //此处请求后台程序，下方是成功后的前台处理……
                $.get("${base}/bcompany/bcompanystateupdate/" + bcid + "?state=0", function (data) {
                    var result = data;
                    if (result.code >= 0) {
                        //刷新页面
                        location.replace(location.href);
                    }
                    else {
                        layer.msg(result.message);
                    }
                })
            });
        }
        else {
            $.get("${base}/bcompany/bcompanystateupdate/" + bcid + "?state=1", function (data) {
                var result = data;
                if (result.code >= 0) {
                    //刷新页面
                    location.replace(location.href);
                }
                else {
                    layer.msg(result.message);
                }
            })
        }
    }

    //开票税号-设置登录界面
    function bcompany_loginConfig(title, url, w, h) {
        layer_show(title, url, w, h);
    }

    //开票税号-开票接口配置
    function bcompany_FPAPIConfig(title, url, w, h) {
        layer_show(title, url, w, h)
    }
</script>
</body>
</html>